-
The proxy object for the current map style.
MGLStyle provides a set of convenience methods for changing Mapbox default styles using
-[MGLMapView styleURL]
. Learn more about Mapbox default styles.It is also possible to directly manipulate the current map style via
-[MGLMapView style]
by updating the style’s data sources or layers.Note
Wait until the map style has finished loading before modifying a map’s style via any of theMGLStyle
instance methods below. You can use the-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]
or-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]
methods as indicators that it’s safe to modify the map’s style.Declaration
Objective-C
@interface MGLStyle : NSObject
Swift
class MGLStyle : NSObject
-
An
MGLStyleValue
object is a generic container for a style attribute value. The layout and paint attribute properties ofMGLStyleLayer
can be set toMGLStyleValue
objects.The
MGLStyleValue
class itself represents a class cluster. Under the hood, a particularMGLStyleValue
object may be either anMGLConstantStyleValue
to represent a constant value or one of the concrete subclasses ofMGLStyleFunction
to represent a value function. Do not initialize anMGLStyleValue
object directly; instead, use one of the class factory methods to create anMGLStyleValue
object.The
MGLStyleValue
class takes a generic parameterT
that indicates the Foundation class being wrapped by this class. Common values forT
include:NSNumber
(for Boolean values and floating-point numbers)NSValue
(forCGVector
,NSEdgeInsets
,UIEdgeInsets
, and enumerations)NSString
NSColor
orUIColor
NSArray
Declaration
Objective-C
@interface MGLStyleValue <T> : NSObject
Swift
class MGLStyleValue<T> : NSObject where T : AnyObject
-
Declaration
Objective-C
@interface MGLLight : NSObject
Swift
class MGLLight : NSObject